﻿CREATE PROCEDURE [dbo].[sp_Get_Accounts]
(
	@AccountType int,
	@Status int
)
AS
	IF @Status IS NULL
		SELECT * FROM dbo.Accounts WHERE AccountType = @AccountType AND [Status] <> 2
	ELSE
		SELECT * FROM dbo.Accounts WHERE AccountType = @AccountType AND [Status] = @Status

RETURN;